


public class Dog {
    public String name;
    public int age;
    public String color;

    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void sleep(){
        System.out.println(this.name+"正在睡觉……");
    }
    public void eat(){
        System.out.println(this.name+"正在吃狗粮……");
    }

    public void show(){
        System.out.println("姓名："+this.name+" 年龄："+this.age+" 颜色："+this.color);
    }

    public static void main(String[] args) {
//        Dog dog1 = new Dog();
//        dog1.age = 5;
//        dog1.name = "哈士奇";
//        dog1.color = "黑白色";

//        Dog dog1 = new Dog("哈士奇",6,"白色");
//        dog1.sleep();
//        dog1.eat();
//        dog1.show();
        Dog dog=null;
        dog.show();

    }
}
